package com.common.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.common.utils.SpringUtil;


/**
 * 系统初始化Servlet
 * 
 * @author Administrator
 * 
 */
public class InitServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * 初始化spring
	 */
	public void init() throws ServletException {
		ApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
		SpringUtil.setContext(context);
	}

}
